package com.xrui.hbase.hashing;

import org.apache.hadoop.hbase.util.Bytes;

public class GenericHasher implements Hasher {
    /* The name of this provider */
    public static final String PROVIDER_NAME = "GenericHasher";

    @Override
    public String getHashString(String string) {
        return Bytes.toStringBinary(getHashBytes(string));
    }

    @Override
    public long getHashCode(String string) {
        return HBaseSalt.getSalt(string);
    }

    @Override
    public byte[] getHashBytes(String string) {
        return Bytes.toBytes(getHashCode(string));
    }

    @Override
    public String getName() {
        return PROVIDER_NAME;
    }
}
